using System;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ClassInterface, ComVisible(false), Guid("1ba3293f-3465-40bb-a321-a7b9c9cc486e"), ProgId("BMC.ARSystem.Menu")]
	public abstract class Menu
	{
		internal enum MemberFlags
		{
			Name = 1,
			NewName,
			RefreshCode = 4,
			Definition = 8,
			HelpText = 16,
			Owner = 32,
			ChangeDiary = 64,
			Properties = 128,
			LastUpdateTime = 256,
			LastModifiedBy = 512,
			ModificationLogLabel = 1024,
			AssignedName = 2048
		}
		[ARStructMemTypeInfo(Name = "menuName", Offset = 3u)]
		private string _name;
		[ARStructMemTypeInfo(Name = "refreshCode", Offset = 4u)]
		private uint _refreshCode;
		[ARStructMemTypeInfo(Name = "helpText", Offset = 6u)]
		private string _helpText;
		[ARStructMemTypeInfo(Name = "timestamp", Offset = 7u)]
		private DateTime _timestamp;
		[ARStructMemTypeInfo(Name = "owner", Offset = 8u)]
		private string _owner;
		[ARStructMemTypeInfo(Name = "lastChanged", Offset = 9u)]
		private string _lastChanged;
		[ARStructMemTypeInfo(Name = "changeDiary", Offset = 10u)]
		private DiaryList _changeDiary;
		[ARStructMemTypeInfo(Name = "objPropList", Offset = 11u)]
		private IDictionary _objPropList;
		[ARStructMemTypeInfo(Name = "modificationLogLabel", Offset = 12u)]
		private string _modificationLogLabel;
		[ARStructMemTypeInfo(Name = "taskName", Offset = 13u)]
		private string _assgnName;
		private ArrayList _content;
		private string _newName;
		private BitVector32 _modifyFlags;
		public string Name
		{
			get
			{
				return this._name;
			}
			set
			{
				if (this._name == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1);
				this._name = value;
			}
		}
		public string NewName
		{
			get
			{
				return this._newName;
			}
			set
			{
				if (this._newName == value || this._newName == this._name)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2);
				this._newName = value;
			}
		}
		public ArrayList Content
		{
			get
			{
				return this._content;
			}
			set
			{
				this._content = value;
			}
		}
		public uint RefreshCode
		{
			get
			{
				return this._refreshCode;
			}
			set
			{
				if (this._refreshCode == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4);
				this._refreshCode = value;
			}
		}
		public string HelpText
		{
			get
			{
				return this._helpText;
			}
			set
			{
				if (this._helpText == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				this._helpText = value;
			}
		}
		public string Owner
		{
			get
			{
				return this._owner;
			}
			set
			{
				if (this._owner == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32);
				this._owner = value;
			}
		}
		public DiaryList ChangeDiary
		{
			get
			{
				return this._changeDiary;
			}
			set
			{
				if (this._changeDiary == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 64);
				this._changeDiary = value;
			}
		}
		public IDictionary Properties
		{
			get
			{
				return this._objPropList;
			}
			set
			{
				if (this._objPropList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 128);
				this._objPropList = value;
			}
		}
		public DateTime LastUpdateTime
		{
			get
			{
				return this._timestamp;
			}
		}
		public string LastModifiedBy
		{
			get
			{
				return this._lastChanged;
			}
		}
		public string ModificationLogLabel
		{
			get
			{
				return this._modificationLogLabel;
			}
			set
			{
				if (this._modificationLogLabel == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1024);
				this._modificationLogLabel = value;
			}
		}
		public string AssignedName
		{
			get
			{
				return this._assgnName;
			}
			set
			{
				if (this._assgnName == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2048);
				this._assgnName = value;
			}
		}
		[ComVisible(false)]
		public BitVector32 MembersModified
		{
			get
			{
				return this._modifyFlags;
			}
			set
			{
				this._modifyFlags = value;
			}
		}
		public int MembersModifiedAsInt
		{
			get
			{
				return this._modifyFlags.get_Data();
			}
			set
			{
				this._modifyFlags = new BitVector32(value);
			}
		}
		public Menu()
		{
			this._modifyFlags = new BitVector32(0);
		}
		public Menu(string name) : this()
		{
			this.Name = name;
		}
		internal Menu(object[] rawData, Server server)
		{
			this.Name = (string)Util.GetAt(rawData, new int[]
			{
				3
			});
			this.RefreshCode = Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				4
			}));
			this.HelpText = (string)Util.GetAt(rawData, new int[]
			{
				6
			});
			this._timestamp = Util.GetDateTime(Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				7
			})));
			this.Owner = (string)Util.GetAt(rawData, new int[]
			{
				8
			});
			this._lastChanged = (string)Util.GetAt(rawData, new int[]
			{
				9
			});
			this.ChangeDiary = DiaryList.Decode((string)Util.GetAt(rawData, new int[]
			{
				10
			}));
			ARTypeMgr arg_124_0 = ARTypeMgr.Instance;
			Type arg_124_1 = typeof(HybridDictionary);
			string arg_124_2 = "System.Int32";
			int[] keyIndex = new int[1];
			this.Properties = arg_124_0.BuildCustomDictionaryFromVariant(arg_124_1, arg_124_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])Util.GetAt(rawData, new int[]
			{
				11
			}), server);
			this._modifyFlags = new BitVector32(1);
		}
		internal static Menu createInstance(object[] rawData, Server server)
		{
			int[] array = new int[2];
			array[0] = 5;
			switch ((uint)Util.GetAt(rawData, array))
			{
			case 1u:
				return new ListMenu(rawData, server);
			case 2u:
				return new QueryMenu(rawData, server);
			case 3u:
				return new FileMenu(rawData, server);
			case 4u:
				return new SqlMenu(rawData, server);
			case 6u:
				return DataDictionaryMenu.createInstance(rawData, server);
			}
			return null;
		}
	}
}
